package edu.uba.fcen.estimacion.estimacion;

public class Means {
	
	private Double meanAgrado;
	private Double meanActivo;
	private Double meanImaginabilidad;
	
	private Double stdevAgrado;
	private Double stdevActivo;
	private Double stdevImaginabilidad;
	
	public Means() {
	}
	
	public Means(double meanAgrado, double meanActivo, double meanImaginabilidad, 
			double stdevAgrado, double stdevActivo, double stdevImaginabilidad) {
		this.meanAgrado = meanAgrado;
		this.meanActivo = meanActivo;
		this.meanImaginabilidad = meanImaginabilidad;
		
		this.stdevAgrado = stdevAgrado;
		this.stdevActivo = stdevActivo;
		this.stdevImaginabilidad = stdevImaginabilidad;
	}
	
	public void add(Means mean) {
		this.meanAgrado += mean.meanAgrado;
		this.meanActivo += mean.meanActivo;
		this.meanImaginabilidad += mean.meanImaginabilidad;
		
		this.stdevAgrado += mean.stdevAgrado;
		this.stdevActivo += mean.stdevActivo;
		this.stdevImaginabilidad += mean.stdevImaginabilidad;
	}
	
	public boolean isValid() {
		return this.meanAgrado != null && this.meanActivo != null && this.meanImaginabilidad != null 
				&& this.stdevAgrado != null && this.stdevActivo != null && this.stdevImaginabilidad != null;
	}
	
	@Override
	public String toString() {
		return "media de agrado: " + this.meanAgrado + 
				" media de activo: " + this.meanActivo +
				" media de imaginabilidad: " + this.meanImaginabilidad +
				"\n stdev de agrado: " + this.stdevAgrado +
				" stdev de activo: " + this.stdevActivo +
				" stdev de imaginabilidad: " + this.stdevImaginabilidad;
	}
	
	public String printMeanAgrado() {
		return String.valueOf(this.meanAgrado);
	}
	
	public String printStdevAgrado() {
		return String.valueOf(this.stdevAgrado);
	}

	public void div(int size) {
		this.meanAgrado = this.meanAgrado / size;
		this.meanActivo = this.meanActivo / size;
		this.meanImaginabilidad = this.meanImaginabilidad / size;
		
		this.stdevAgrado = this.stdevAgrado / size;
		this.stdevActivo = this.stdevActivo / size;
		this.stdevImaginabilidad = this.stdevImaginabilidad / size;
	}
	
	public double getMeanAgrado() {
		return this.meanAgrado;
	}
	
	public double getStdevAgrado() {
		return this.stdevAgrado;
	}

	public String printMedias() {
		return this.meanAgrado + "\t" + this.meanActivo + "\t" + this.meanImaginabilidad;
	}

	public Double getMeanActivo() {
		return meanActivo;
	}
	
	public Double getStdevActivo() {
		return stdevActivo;
	}

	public Double getMeanImaginabilidad() {
		return meanImaginabilidad;
	}
	
	public Double getStdevImaginabilidad() {
		return stdevImaginabilidad;
	}
	
	

}
